import Vue from 'vue';
import Vuex from 'vuex';
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex);
const config = {
    plugins: [createPersistedState()],
    state: {
        token: null,
        active: null
    },
    getters: {
        token: state => state.token,
        active: state => state.active,
    },
    mutations: {
        updateToken (state, payload) {
            state.token = payload;
        },
        updateActive (state, payload) {
            state.active = payload;
        },
    },
    actions: {}
}
const store = new Vuex.Store(config);
export default store;